<%@ taglib prefix="c" uri="/WEB-INF/tlds/hdiv-c.tld"%>
<%@ taglib prefix="form" uri="/WEB-INF/tlds/hdiv-spring-form-3_0_4.tld"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
<c:url value="selecUnidMoneMultiSucu.html" var="seleccionarModulo"/>    
<script src="javascript/jquery.displaytag-ajax-1.2.js" type="text/javascript"></script>
  <script type="text/javascript">  
    $(document).ready(function(){ 
    
        $('span.pagelinks>a, table#dispTable>thead>tr>th>a').live('click', function(){
            $.get($(this).attr('href'), function(responseText, status, xmlHttpRequest){
                $('#displayTagDiv').html($('#displayTagDiv', responseText).html());
                
                }
            )            
            return false;
        })

        $.getJSON("<c:url value='selecUnidMoneMultiSucu.html'/>", {accion : "searchDesMod" },function(data){
            $("#desModulo").autocomplete({source:data});
        });        
        $("form").submit(function(){
            return false;
        });
        $("#desModulo").bestupper({
            clear:false
        });
        $("#mostrar").click(function(){ 
            $.get("<c:url value='selecUnidMoneMultiSucu.html'/>",{accion:"buscarModulo",desModulo:$("#desModulo").val()}, function(responseText, status, xmlHttpRequest){
                $('#displayTagDiv').html($('#displayTagDiv', responseText).html());
                }
            )            
        });
        $("#aceptar").click(function(){             
            self.close();
        });  
    });
    function setChkModulo(checkObj){        
        var idChkObj = checkObj.checked;
        if(idChkObj){
            $.getJSON("<c:url value='selecUnidMoneMultiSucu.html'/>", {accion : "selectCodModulo",codMat: checkObj.value});
        }else{
            $.getJSON("<c:url value='selecUnidMoneMultiSucu.html'/>", {accion : "deselectCodCuenta",codMat: checkObj.value});
        }        
    }   
    function setChkTodos(checkTodos){
        var booCheckTodos = "Check Object: "+ checkTodos.checked;
        $.get("<c:url value='selecUnidMoneMultiSucu.html'/>",{accion:"selectTodos",codTodos:checkTodos.checked}, function(responseText, status, xmlHttpRequest){
            $('#displayTagDiv').html($('#displayTagDiv', responseText).html());
            }
        )        
    }
  </script>
<body>
<form:form modelAttribute="form" name="form" action="${seleccionarModulo}">
<form:hidden path="accion"/>
<form:hidden path="cliente"/>
    <table id="fullheighttable" width="500" align="center">
        <tr>
            <td align="left" valign="top" class="fondo_modal padtop16left21">
                <table>
                    <tr>
                        <td class="verdana11bazul">Boveda</td>
                        <td>
                            <form:input path="desModulo" cssClass="fondo_txtbox258"/>
                        </td>
                        <td>
                            <input type="button" class="boton" id="mostrar" value="Mostrar"/>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" style="color:red;font-weight:bold;text-align:left;">
                        Lista de Bovedas por U.M.
                        </td>
                    </tr>                    
                    <tr>
                        <td colspan="3">                        
                        <input type='checkbox' id='chkTodos' onclick='setChkTodos(this)'/> Todos
                        <div id="displayTagDiv">
                        <c:set var="count" value="0"/>
                        <display:table name="listModulos" class="its" 
                                       pagesize="10" id="modulo"
                                       requestURI="/selecUnidMoneMultiSucu.html" >
                            
                            <display:column style="width:30px;text-align:left;" title="Sel">
                                <c:set var="count" value="${count+1}"/>
                                <input type="checkbox" id="_chk${modulo.codigoBovedaCompleto}" name="_chk" value="${modulo.codigoBovedaCompleto}" onclick="setChkModulo(this);" ${modulo.chkMarca}/>
                            </display:column> 
                            <display:column style="width:250px;text-align:left;" property="descripcion" title="Descripci&oacute;n"/>
                            <display:column style="width:170px;text-align:left;" property="desSucursal" title="Sucursal"/>
                        </display:table>
                        </div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" align="center">                
                            &nbsp;
                        </td>
                    </tr>                       
                    <tr>
                        <td colspan="3" align="center">                
                            <input type="button" value="Aceptar" id="aceptar" class="boton"/>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr><td>
            <div id="matrices"></div>
        </td></tr>
    </table>
</form:form>
</body>